data("ny_elec")
head(ny_elec)
#> date_time y
#> 1 2015-07-01 05:00:00 14444
#> 2 2015-07-01 06:00:00 13809
#> 3 2015-07-01 07:00:00 13435
#> 4 2015-07-01 08:00:00 13144
#> 5 2015-07-01 09:00:00 13147
#> 6 2015-07-01 10:00:00 13771
class(ny_elec)
#> [1] "tbl_ts" "tbl_df" "tbl" "data.frame"library(TSstudio)
ts_plot(ny_elec,
title = "Net Generation of Electricity for the New York Region",
Ytitle = "Megawatthours",
Xtitle = "Source: US Energy Information Administration (Jan 2020)",
slider = TRUE)md1 <- trainLM(input = ny_elec,
y = "y",
seasonal = c("month"),
trend = list(linear = TRUE))
plot_res(md1)